<template>
  <el-container style="height: 100vh;">
    <el-aside width="200px">
      <el-menu :default-active="activeIndex" class="el-menu-vertical-demo" @select="handleSelect">
        <el-menu-item index="1">首页</el-menu-item>
        <el-submenu index="2">
          <template slot="title">系统管理</template>
          <el-menu-item index="2-1">用户管理</el-menu-item>
          <el-menu-item index="2-2">菜单管理</el-menu-item>
          <el-menu-item index="2-3">角色管理</el-menu-item>
        </el-submenu>
        <el-menu-item index="3">海报管理</el-menu-item>
        <el-menu-item index="4">素材管理</el-menu-item>
      </el-menu>
    </el-aside>
    <el-container>
      <el-header>Header</el-header>
      <el-main>Main</el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  data() {
    return {
      activeIndex: '1', // 设置默认激活的菜单项
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
      // 这里可以根据 key 来处理不同的页面展示逻辑
    },
  },
};
</script>

<style>
.el-aside {
  background-color: #d3dce6;
}

.el-header {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
  text-align: center;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
}
</style>
